package com.jiedeng.mapper;

import com.jiedeng.entity.ResponsibilityCrop;
import com.jiedeng.mapper.provider.TaskSqlProvider;
import com.jiedeng.model.Person;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * @author zhouyb
 * @ClassName: TaskMapper
 * @Description: 任务管理
 * @date 2018/5/4 9:41
 */
@Mapper
public interface TaskMapper {
    /**
     * 评分查找责任单位
     *
     * @param projectId
     * @param checkItemId
     * @param checkItemRuleId
     * @return
     */
    @Results({
            @Result(column = "Corp_ID", property = "id"),
            @Result(column = "Post_ID", property = "postId"),
            @Result(column = "Corp_Caption", property = "caption"),
            @Result(column = "Corp_WeightLevel", property = "corpWeightLevel")
    })
    @SelectProvider(type = TaskSqlProvider.class, method = "findResponsibilityCropSql")
    List<ResponsibilityCrop> findResponsibilityCropList(long projectId, long checkItemId, long checkItemRuleId,String checkId);

    /**
     * 评分查找责任人
     *
     * @param projectId
     * @param corpId
     * @return
     */
    @Results({
            @Result(column = "Person_ID", property = "id"),
            @Result(column = "Corp_ID", property = "corpId"),
            @Result(column = "Post_ID", property = "postId"),
            @Result(column = "regdevice", property = "regDevice"),
            @Result(column = "islock", property = "isLock")
    })
    @SelectProvider(type = TaskSqlProvider.class, method = "findResponsibilityPersonSql")
    List<Person> findResponsibilityPersonList(long projectId, long corpId,long postId,String checkId);
}
